<?php
class UniqueCode extends Model
{
    public static $id = '';

    public static function getUserCode()
    {
        $gid = self::getGlobalId(1);
        self::$id = $gid;
        $char = Fun::randChar(2);
        return 'U'.date('Ymd').str_pad($gid, 6, '0', STR_PAD_LEFT).$char;
    }

}